import csv

filename = "xiaofei.csv"

with open(filename, "r") as f:
    reader = csv.reader(f)
    headers = next(reader)
    rows = [dict(zip(headers, row)) for row in reader]

province = input("请输入地区：")
items = input("请输入需要查找的项目，以逗号分隔：").split(",")

matches = []
for row in rows:
    if row["地区"] == province:
        match = {}
        for item in items:
            if item in row:
                match[item] = row[item]    
        if match:
            matches.append(match)


if len(matches) == 0:
    print("未找到符合条件的行")
else:
    print("您输入的地区是：", province)
    for row in matches:
        for item in items:
            if item in row:
                print(f"{item}: {row[item]}")
            else:
                print(f"{item}:未找到")
